/**
 * @author Evgeny Sorokin
 */
Ext.define('USocial.view.Main', {
    extend: 'Ext.Panel',
    
    requires : ['Ext.TitleBar', 'USocial.view.InviteFriendsList', 'USocial.view.Map', 
    			'USocial.view.MainBar', 'USocial.view.InviteFriendsPanel'],
    
    config: {
    	layout : 'fit',
    	
        items: [
	        {
	        	xtype : 'mainBar'
	        },	
        	{
        		xtype : 'container',
        		id : 'mainContainer',
        		layout : 'card',
        		items : [
        			{
						xtype : 'mapPanel'
        			},
        			{
						xtype : 'inviteFriendsPanel'
        			},
        			{	
        				xtype : 'panel',
        				items : [
     	        				{
     	        					xtype : 'button',
     	        					text : 'inappbrowser test',
     	        					handler : function(){
 										Ext.Viewport.add(Ext.create('USocial.view.PostMessageModal'));
/*     	        						var ref = window.open('https://oauth.vk.com/authorize?client_id=4181551&scope=friends,wall,offline&redirect_uri=https://oauth.vk.com/blank.html&display=touch&v=5.10&response_type=token&scope=offline', '_blank', 'location=no');
     	        						ref.addEventListener('loadstop', function(event) { 
         	        						Ext.device.Notification.show({
         	        						    title: 'Verification',
         	        						    message: event.url,
         	        						    buttons: Ext.MessageBox.OKCANCEL,
         	        						    callback: function(button) {
         	        						        if (button === "ok") {
         	        						            console.log('Verified');
         	        						        } else {
         	        						            console.log('Nope');
         	        						        }
         	        						    }
         	        						});
     	        						});*/

     	        					}
     	        				}
             				]
        			}
        		]
        	}
        ]

    }

});
